package com.prj.ufdm.demo.tutorial.despatterns.creational.factory.factorymethod;
/**
  * 简单工厂方法
 * @author Administrator
 *
 */
public class SimpleFactory {
	
	public static final int SEND_TYPE_EMAIL = 1;
    public static final int SEND_TYPE_SMS = 2; 

    public static Sender createSender(int type) {
        switch (type) {
            case SEND_TYPE_EMAIL:
                return new SenderOfMail();
            case SEND_TYPE_SMS:
                return new SenderOfSMS();
            default:
                return new SenderOfMail();
        }
    }
    
}
